---
title: Retrieve policy header data
summary: Loads the aggregate "policy header" view object for a given policy via an Oracle stored-procedure retrieval.
status: draft
owner: SAIF Claims BOF team
last_reviewed: 2026-08-21
library: SAIF.Business.View.Policy
reference_type: embedded
operation_id: OP-VP-001
trigger: Caller invokes clsPolicyData.GetPolicyData(...)
---

# Retrieve policy header data

Loads and populates a `clsPolicyData` object — the library's principal factory surface — used as
the entry point for most policy lookups by the Claims Legal front end.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-VP-001 |
| **Trigger** | Caller invokes `clsPolicyData.GetPolicyData(DPI, PolicyNum[, UserAccessLevel])` |
| **Inputs** | Policy number (or batch of policy numbers), optional `UserAccessLevel` |
| **Outputs** | Populated, read-only `clsPolicyData` object (or an object with an attached error message if not found) |
| **Primary components** | `clsPolicyData.GetPolicyData` |
| **Entry point** | `SAIF.Business.View.Policy\clsPolicyData.vb` |

## Steps

1. Caller invokes one of four `GetPolicyData` overloads (by `Criteria`, by policy number, by a
   batch of policy numbers, by policy number + `UserAccessLevel`). The call delegates to a
   `Criteria` object and `IDataPortalInfo.DataAccessLayer.RetrieveObject`.
   - Delegates to a referenced/framework operation: the actual `RetrieveObject` call is implemented
     in the BOF Framework's data access layer (`saif.framework.core`), which executes the
     `IDataRequest` against the configured `IDataPortalInfo` and returns an `IBusinessObject`.

     > **Origin**: `RetrieveObject` lifecycle (`BeforeRetrieve`/execute/`AfterRetrieve`) is
     > implemented in `clsBusinessBase` (`saif.framework.core`, frameworkDensity=20). No
     > concrete, domain-specific step-level description was available from the dependency
     > documentation lookup for this base class beyond the generic mechanism.
2. `BeforeRetrieve` builds the request ([SQL-VP-008](../sql/SQL-008-getpolicy.md)): sets
   `CommandType=StoredProcedure`, `RequestType=Reader`, adds parameter `apolicynum` and a cursor
   parameter `recordset`.
3. `AfterRetrieve` reads the first row of the returned `clsSAIFDataReader` and calls `Fill(Reader)`
   to populate all properties (policy number, name, status, secure-policy code, agency,
   associations metadata, etc.), then calls `MarkOld()`.
4. Business rule enforced: `PolicyNum` must be greater than zero
   ([BR-VP-001](../business-rules.md#br-vp-001-valid-policy-number-required)).
   - On failure: `IsValid` is set to `False` and a broken-rule message ("Error: Invalid policy
     number.") is attached to the object; no exception is thrown.
5. Result: a populated, read-only `clsPolicyData` object is returned to the caller.
   - If no row is found: an error message is added to the object instead of throwing.

## Process flow

```mermaid
flowchart TD
	Start([Caller invokes GetPolicyData]) --> Build[BeforeRetrieve builds StoredProcedure request]
	Build --> Exec[Execute SQL-VP-008 via RetrieveObject]
	Exec --> Found{Row returned?}
	Found -->|Yes| Fill[AfterRetrieve calls Fill and MarkOld]
	Fill --> Rule{PolicyNum > 0?}
	Rule -->|Yes| Ok([Valid clsPolicyData returned])
	Rule -->|No| Invalid([IsValid=False, broken-rule message attached])
	Found -->|No| NotFound([Error message attached to object])
```

## Failure and edge-case behavior
- No row found for the requested policy number: an error message is attached to the returned object rather than an exception being thrown.
- `PolicyNum <= 0`: `IsValid` becomes `False` with the broken-rule message "Error: Invalid policy number."

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- `SAIF.Business.View.Policy\clsPolicyData.vb`
